
package cn.zlg.common.springmvc.validate.constraintsvalidator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import cn.zlg.common.springmvc.validate.constraints.NotNull;

/**
 * Validate that the object is not <code>null</code>.
 *
 * @author Emmanuel Bernard
 */
public class NotNullValidator implements ConstraintValidator<NotNull, Object> {

    public void initialize(NotNull parameters) {
    }

    public boolean isValid(Object object, ConstraintValidatorContext constraintValidatorContext) {
        return object != null;
    }
}